local skel = fk.CreateSkill {
  name = "rmt__muxian",
  tags = {Skill.Lord},
}

skel:addEffect(fk.Damage, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target and not target.dead and data.to == player
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    event:setCostData(self, {tos = {target}})
    if target.kingdom == "qi" then
      return room:askToSkillInvoke(target, {skill_name = skel.name, prompt = "#rmt__muxian-recover:"..player.id})
    else
      return room:askToSkillInvoke(player, {skill_name = skel.name, prompt = "#rmt__muxian-draw:"..target.id})
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    if target.kingdom == "qi" then
      room:recover { num = 1, skillName = skel.name, who = player, recoverBy = target }
    else
      player:drawCards(1, skel.name)
      if not target.dead then
        target:drawCards(1, skel.name)
      end
      room:changeKingdom(target, "qi", true)
    end
  end,
})

Fk:loadTranslationTable{
  ["rmt__muxian"] = "募贤",
  [":rmt__muxian"] = "主公技，一名角色对你造成伤害后，若其为齐势力，其可以令你回复一点体力；若为其他势力，你可以与其各摸一张牌，再将其改为齐势力。",
  ["#rmt__muxian-recover"] = "募贤:你可以令 %src 回复一点体力",
  ["#rmt__muxian-draw"] = "募贤:你可以与 %src 各摸一张牌，再将其改为齐势力",

  ["$rmt__muxian1"] = "布衣之士可轻爵禄，万乘之主岂可轻贤士？",
  ["$rmt__muxian2"] = "君者劳于索人，寡人得仲父，何为不易？",
}

return skel
